

[#include "../include/html_header.html"/]
<link rel="stylesheet" href="${base}/assets/global/css/item.css"/>
<link rel="stylesheet" href="${base}/assets/jqzoom/css/jqzoom.css"/>
<script language="javascript" src="${base}/assets/jqzoom/js/base.js"></script>
<script language="javascript" src="${base}/assets/jqzoom/js/jquery.jqzoom.js"></script>


<script src="${base}/assets/global/js/item.js"  type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
//    $(function(){
//        jQuery.post("${base}/historyRecord.htm",{productId:"${product.id}"},function(data){});
//    });
    function g(o){
        return document.getElementById(o);
    }

    [#if category.colorsize]
    function addToCart(productId,count,fashId) {
        if(!Core.username()) {
            location.href='${loginUrl}';
            return;
        }
        jQuery.post('${base}/cart/add_orderItem.htm', {
            'productId' : productId,
            'productAmount' : count,
            'fashId': fashId
        }, function(data) {
            if(data.status==1) {
                location.href='${base}/cart/shopping_cart.htm?backUrl=${location}';
            } else if(data.status==0) {
                location.href='${loginUrl}';
            } else {
                alert(data.error);
            }
        },'json');
    }
    [#else]
    function addToCart(productId,count) {
        if(!Core.username()) {
            location.href='${loginUrl}';
            return;
        }
        jQuery.post('${base}/cart/add_orderItem.htm', {
            'productId' : productId,
            'productAmount' : count
        }, function(data) {
            if(data.status==1) {
                location.href='${base}/cart/shopping_cart.htm?backUrl=${location}';
            } else if(data.status==0) {

                location.href='${loginUrl}';
            } else {
                alert(data.error);
            }
        },'json');
    }
    [/#if]
    function addToPopularity(popularityId){
        if(!Core.username()) {
            location.href='${loginUrl}';
            return;
        }
        jQuery.post('${base}/cart/add_popularity.htm', {
            'popularityId': popularityId
        }, function(data) {
            if(data.status==1) {
                location.href='${base}/cart/shopping_cart.htm?backUrl=${location}';
            } else if(data.status==0) {
                location.href='${loginUrl}';
            } else {
                alert(data.error);
            }
        },'json');
    }


</script>
</head>
<body>
[#include "../include/html_header_top.html"/]


<div class="am-g am-g-fixed" >

         <div class="am-u-sm-6">
             <div><h2><font id="productMainName">${product.name!}</font></h2></div>
             <div id="preview" class="spec-preview">
                 <span class="jqzoom">
                       [#if product.pictures?? && product.pictures?size gt 0]
                     [#list product.pictures as pic]
                     [#if pic_index==0]
                     <a  href="${pic.appPicturePath!}" >
                         <img jqimg="${pic.appPicturePath!}" src="${pic.bigPicturePath!}" width="345" height="345"/>
                     </a>
                     [/#if]
                     [/#list]
                     [/#if]


                 </span>
             </div>
             <!--缩图开始-->
             <div class="spec-scroll"> <a class="prev">&lt;</a> <a class="next">&gt;</a>
                 <div class="items">
                     <ul>
                         [#if product.pictures?? && product.pictures?size gt 0]
                         [#list product.pictures as pic]

                         <li><img bimg="${pic.bigPicturePath!}"  src="${pic.picturePath!}"  onmousemove="preview(this);"/></li>
                         <li><img bimg="${pic.bigPicturePath!}"  src="${pic.bigPicturePath!}"  onmousemove="preview(this);"/></li>
                         <li><img  bimg="${pic.bigPicturePath!}" src="${pic.appPicturePath!}"  onmousemove="preview(this);"/></li>
                         [/#list]
                         [/#if]

                     </ul>
                 </div>
             </div>



         </div>
        <div class="am-u-sm-6">


            <div class="property property_box coat">
                <div class="specific_info1">
                    [#if category.colorsize]
                    <input type="hidden" id="current_merchantId" value="[#if product.productFashion??]${product.productFashion.id}[/#if]"/>
                    [#if product.productFashion??]
                    <dl class="clearfix">
                        <dt>销&nbsp;&nbsp;售&nbsp;价：</dt>
                        <dd><span class="price_1store productPriceSpan  f24">¥<b class="sys_item_price">${product.productFashion.salePrice!}</b></span>
                            <span class="price_1store">元</span>
			    <span class="gift_points">赠送积分：
			    <strong> [#if product.score??]${product.score!}分[#else]无积分[/#if]</strong>
			    </span>
                        </dd>
                    </dl>
                    <dl class="clearfix">
                        <dt>市&nbsp;&nbsp;场&nbsp;价：</dt>
                        <dd><del class="old_price">¥<b class="sys_item_mktprice">${product.productFashion.marketPrice!}</b>元</del></dd>
                    </dl>
                    [/#if]
                    [#else]
                    <dl class="clearfix">
                        <dt>销&nbsp;&nbsp;售&nbsp;价：</dt>
                        <dd><span class="price_1store productPriceSpan  f24">¥${product.salePrice!}</span>
                            <span class="price_1store">元</span>
			    <span class="gift_points">赠送积分：
			    <strong> [#if product.score??]${product.score!}分[#else]无积分[/#if]</strong>
			    </span>
                        </dd>
                    </dl>
                    <dl class="clearfix">
                        <dt>市&nbsp;&nbsp;场&nbsp;价：</dt>
                        <dd><del class="old_price">¥${product.marketPrice!}元</del></dd>
                    </dl>
                    [/#if]
                </div>
                <div class="specific_info2">
                    [#if category.colorsize]
                    <div class="sys_item_spec">
                        [#list standardTypeList as standardType]
                        [#if standardType.dataType]
                        <dl class="sys_item_specpara clearfix" data-sid="${standardType_index+1}" [#if arr??]data-attrval="${arr[standardType_index]}"[/#if]>
                        <dt>${standardType.name}</dt>
                        <dd>
                            <ul class="sys_spec_img">
                                [#list psList as ps]
                                [#if standardType.id=ps.type.id]
                                <li data-aid="${ps.standard.id!}" [#if product.productFashion.standards?seq_contains(ps.standard)]class="selected"[#else]class=""[/#if]><a href="javascript:;" title="${ps.standard.name}"><img src="${ps.imgPath!}" alt="${ps.standard.name}" /></a><i></i></li>
                                [/#if]
                                [/#list]
                            </ul>
                        </dd>
                        </dl>
                        [#else]
                        <dl class="sys_item_specpara clearfix" data-sid="${standardType_index+1}" [#if arr??]data-attrval="${arr[standardType_index]}"[/#if]>
                        <dt>${standardType.name}</dt>
                        <dd>
                            <ul class="sys_spec_text">
                                [#list psList as ps]
                                [#if standardType.id=ps.type.id]
                                <li data-aid="${ps.standard.id!}" [#if product.productFashion.standards?seq_contains(ps.standard)]class="selected"[#else]class=""[/#if]><a href="javascript:;" title="${ps.standard.name}">${ps.standard.name}</a><i></i></li>
                                [/#if]
                                [/#list]
                            </ul>
                        </dd>
                        </dl>
                        [/#if]
                        [/#list]
                    </div>
                    [/#if]
                    <dl id="goToBuyDistrict" class="clearfix">
                        <dt>我      要      买：</dt>
                        <dd>
                            <div class="computing">
                                <input type="button" class="reduce" onclick="decrementAll();"/>
                                <input type="text" id="product_amount" name="productAmount" onchange ="buyButtonNumChange('product_amount')" class="num" onkeyup="inputOnlyNum(this, 1, 999);" value="1"/>
                                <input type="button" class="add" onclick="incrementAll();"/>
                            </div>
                        </dd>
                    </dl>
                    [#if category.colorsize]
                    <table>
                        <tr id="seriesShow" class="hide">
                            <td width="84"><span class="select">您选择了：</span></td>
                            <td colspan="4">
							<span class="result">
							<b class="sys_item_attitude">
                                [#if product.productFashion??]${product.productFashion.attitude!}[/#if]
                            </b>
							</span>&nbsp;
                            </td>
                        </tr>
                        <tr id="buyButtonsDistrict">
                            <td width="84">&nbsp;</td>
                            <td>
                                <input type="button" class="am-btn am-btn-warning" value="加入购物车" onclick="javascript:addToCart(${product.id},$('#product_amount').val(),$('#current_merchantId').val());"/>
                            </td>
                            <td>

                            </td>
                        </tr>
                    </table>
                    [#else]
                    <table class="am-table">
                        <tr>
                            <td width="84">&nbsp;</td>
                            <td>
                                <input type="button" class="am-btn am-btn-warning" value="加入购物车" onclick="javascript:addToCart(${product.id},$('#product_amount').val());"/>
                            </td>
                            <td>

                            </td>
                        </tr>
                    </table>
                    [/#if]
                </div>
                <div class="specific_info1">
                    <dl class="clearfix">
                        <dt>商品编号：</dt>
                        <dd id="productCode">${product.productExt.code!}</dd>
                    </dl>
                    <dl class="clearfix">
                        <dt>分&nbsp;&nbsp;享&nbsp;到：</dt>
                        <dd class="share_ico">
                            [#if category.colorsize]
                            <a class="ico_sina" href="javascript:(function(){var rul=location.href;if(rul.indexOf('?')>0){rul = rul +'&'}else{rul = rul +'?'};rul = rul +'tarcker_u=9402576';window.open(' http://v.t.sina.com.cn/share/share.php?title=【${product.name!}】,商城价 ￥[#if product.productFashion??]${product.productFashion.salePrice!}[/#if]&url='+encodeURIComponent(rul),'_blank','width=615,height=505');})()">新浪微博</a>
                            <a class="ico_qq" href="javascript:void(0)" onclick="posttoWb('http://v.t.qq.com/share/share.php','${product.name!}￥[#if product.productFashion??]${product.productFashion.salePrice!}[/#if]','2fc26c2514bb48ec891170ce68db2683');" >腾讯微博</a>
                            [#else]
                            <a class="ico_sina" href="javascript:(function(){var rul=location.href;if(rul.indexOf('?')>0){rul = rul +'&'}else{rul = rul +'?'};rul = rul +'tarcker_u=9402576';window.open(' http://v.t.sina.com.cn/share/share.php?title=【${product.name!}】,商城价 ￥${product.salePrice!}&url='+encodeURIComponent(rul),'_blank','width=615,height=505');})()">新浪微博</a>
                            <a class="ico_qq" href="javascript:void(0)" onclick="posttoWb('http://v.t.qq.com/share/share.php','${product.name!}￥${product.salePrice!}','2fc26c2514bb48ec891170ce68db2683');" >腾讯微博</a>
                            [/#if]
                        </dd>
                    </dl>
                </div>
            </div><!-- property -->

    </div>
</div>
    <!-- 促销套餐展示-->
<div class="am-g am-g-fixed" >
    [#if product.popularityGroups??]
    <div class=" am-u-sm-centered">
        <div class="am-tabs am-margin" data-am-tabs>
            <ul class="am-tabs-nav am-nav am-nav-tabs">
            [#list product.popularityGroups as popularityGroup]
            <li [#if popularityGroup_index=0]class="am-active"[#else]class=""[/#if] style="cursor: hand"><a href="#tab_${popularityGroup_index+1}">${popularityGroup.name!}</a></li>
            [/#list]
          </ul>
            <!-- 展示套餐组合-->
            <div class="am-tabs-bd">
                [#list product.popularityGroups as popularityGroup]
                        <div class="am-tab-panel am-fade am-in am-active" id="tab_${popularityGroup_index+1}">
                            <div class="am-g am-margin-top">
                                <table class="am-table">
                                    <tr>
                                        [#list popularityGroup.products as product]
                                        <td> <a href="${product.url!}" target="_blank"><img src="${product.productExt.coverImg!}" width="100" height="110" alt="" /></a>
                                            <p>[@text_cut s=product.name len='20' append='...'/] </p></td>
                                        [/#list]
                                        <td width="84">&nbsp;</td>
                                        <td>
                                            <center>优惠：${popularityGroup.price!}</center>
                                            <input type="button" class="add_shopping_cart" value="购买套餐" onclick="javascript:addToPopularity(${popularityGroup.id});"/>
                                        </td>
                                    </tr>
                                </table>
                               </div>

                </div>

            [/#list]
            </div>
        <!-- 展示套餐组合结束-->

</div>
    [/#if]
</div>
        </div>
    <!-- 促销套餐展示结束-->
    <!-- 商品详情展示-->
    <div class="am-g am-g-fixed" >
<div class="am-u-sm-12 am-u-sm-centered">
        <div class="am-tabs am-margin" data-am-tabs>
            <ul class="am-tabs-nav am-nav am-nav-tabs">
                <li  class="am-active"><a href="#tab_sec_1">商品祥情</a></li>
                <li><a href="#tab_sec_2">服务承诺</a></li>
                <li><a href="#tab_sec_3">商品评价</a></li>
                <li><a href="#tab_sec_4">商品咨询</a></li>
                <li><a href="#tab_sec_5">成交记录</a></li>
             </ul>
            <div class="am-tabs-bd">
                <div class="am-tab-panel am-fade am-in am-active" id="tab_sec_1">
                    <div class="am-g am-margin-top">
                        ${product.text!}
                    </div>
                </div>

                <div class="am-tab-panel am-fade am-in am-active" id="tab_sec_2">
                    <div class="am-g am-margin-top">
                        ${product.text1!}
                    </div>
                </div>
                <div class="am-tab-panel am-fade am-in am-active" id="tab_sec_3">
                    <div class="am-g am-margin-top">
                        <iframe width="740"  frameborder=0 scrolling=no  src="${base}/searchDiscussPage.htm?productId=${product.id!}" name="rightFrame" noresize="noresize" id="rightFrame"  height="800">
                        </iframe>
                    </div>
                </div>
                <div class="am-tab-panel am-fade am-in am-active" id="tab_sec_4">
                    <div class="am-g am-margin-top">
                        <iframe width="740"  frameborder=0 scrolling=no  src="${base}/consultProduct.htm?productId=${product.id!}" name="rightFrame" noresize="noresize" id="rightFrame"  height="800">
                        </iframe>
                    </div>
                </div>
                <div class="am-tab-panel am-fade am-in am-active" id="tab_sec_5">
                    <div class="am-g am-margin-top">
                        <iframe width="740"  frameborder=0 scrolling=no  src="${base}/bargain.htm?productId=${product.id!}" name="rightFrame" noresize="noresize" id="rightFrame"  height="800">
                        </iframe>
                    </div>
                </div>
            </div>

</div>
</div>
 </div>
<!--商品详情展示结束 -->


</div>
[#include "../include/footer.html"/]
[#if category.colorsize]
<script language="JavaScript" type="text/JavaScript">
    var sys_item={
            [#if product.productFashion??]
    "mktprice":"${product.productFashion.marketPrice!}",
            "price":"${product.productFashion.salePrice!}",
            "attitude":"${product.productFashion.attitude!}",
            "fashId":"${product.productFashion.id!}",
            [#else]
    "mktprice":"",
            "price":"",
            "attitude":"",
            "attitude":"",
            "fashId":"",
            [/#if]

    "sys_attrprice":{
        [#list product.fashions as fash]
        [#if fash_has_next]
        "${fash.nature!}":{"price":"${fash.salePrice!}","mktprice":"${fash.marketPrice!}","attitude":"${fash.attitude!}","fashId":"${fash.id!}"},
        [#else]
        "${fash.nature!}":{"price":"${fash.salePrice!}","mktprice":"${fash.marketPrice!}","attitude":"${fash.attitude!}","fashId":"${fash.id!}"}
        [/#if]
        [/#list]
    }
    };

    //商品规格选择
    $(function(){
        $(".sys_item_spec .sys_item_specpara").each(function(){
            var i=$(this);
            var p=i.find("ul>li");
            p.click(function(){

                if(!!$(this).hasClass("selected")){
                    $(this).removeClass("selected");
                    i.removeAttr("data-attrval");
                }else{
                    $(this).addClass("selected").siblings("li").removeClass("selected");
                    i.attr("data-attrval",$(this).attr("data-aid"))
                }
                getattrprice() //输出价格
            })
        })
        //获取对应属性的价格
        function getattrprice(){
            var defaultstats=true;
            var _val='';
            var _resp={
                mktprice:".sys_item_mktprice",
                price:".sys_item_price",
                attitude:".sys_item_attitude"
            }  //输出对应的class
            $(".sys_item_spec .sys_item_specpara").each(function(){
                var i=$(this);
                var v=i.attr("data-attrval");
                if(!v){
                    defaultstats=false;
                }else{
                    _val+=_val!=""?"_":"";
                    _val+=v;
                }
            })

            if(!!defaultstats){
                if((sys_item['sys_attrprice'][_val])!=undefined){
                    _mktprice=sys_item['sys_attrprice'][_val]['mktprice'];
                    _price=sys_item['sys_attrprice'][_val]['price'];
                    _attitude=sys_item['sys_attrprice'][_val]['attitude'];
                    _fashId=sys_item['sys_attrprice'][_val]['fashId'];
                }else{
                    alert("您选择的商品已无库存！");
                    _mktprice=sys_item['mktprice'];
                    _price=sys_item['price'];
                    _attitude=sys_item['attitude'];
                    _fashId=sys_item['fashId'];
                }

            }else{
                _mktprice=sys_item['mktprice'];
                _price=sys_item['price'];
                _attitude=sys_item['attitude'];
                _fashId=sys_item['fashId'];
            }
            //输出价格
            $(_resp.mktprice).text(_mktprice);  ///其中的math.round为截取小数点位数
            $(_resp.price).text(_price);
            $(_resp.attitude).text(_attitude);
            $("#current_merchantId").val(_fashId);
        }
    })

</script>
[/#if]
</body>
</html>